package com.rover.entity.system;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * TuserTrole entity. @author 磤
 */
@Entity
@Table(name = "S_UserRole", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
public class UserRole  implements Serializable{

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long id;
	private User tuser;
	private Role trole;

	// Constructors

	/** default constructor */
	public UserRole() {
	}
	
	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public User getTuser() {
		return this.tuser;
	}

	public void setTuser(User tuser) {
		this.tuser = tuser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLE_ID", nullable = false)
	public Role getTrole() {
		return this.trole;
	}

	public void setTrole(Role trole) {
		this.trole = trole;
	}

}